package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallCart;
import com.appkubes.mall.core.po.MallCartExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallCartMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCartSqlProvider.class, method="countByExample")
    long countByExample(MallCartExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallCartSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallCartExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_cart",
        "where cart_key = #{cartKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String cartKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_cart (cart_key, app_key, ",
        "user_key, goods_key, ",
        "num, attr_keys, create_time, ",
        "leader_key, update_time, ",
        "attr_names, store_key, ",
        "saas_userid, activity_key, ",
        "activity_endtime, customer_key, ",
        "version)",
        "values (#{cartKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{userKey,jdbcType=VARCHAR}, #{goodsKey,jdbcType=VARCHAR}, ",
        "#{num,jdbcType=INTEGER}, #{attrKeys,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, ",
        "#{leaderKey,jdbcType=VARCHAR}, #{updateTime,jdbcType=INTEGER}, ",
        "#{attrNames,jdbcType=VARCHAR}, #{storeKey,jdbcType=VARCHAR}, ",
        "#{saasUserid,jdbcType=CHAR}, #{activityKey,jdbcType=VARCHAR}, ",
        "#{activityEndtime,jdbcType=VARCHAR}, #{customerKey,jdbcType=INTEGER}, ",
        "#{version,jdbcType=INTEGER})"
    })
    int insert(MallCart record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallCartSqlProvider.class, method="insertSelective")
    int insertSelective(MallCart record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCartSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="cart_key", property="cartKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_keys", property="attrKeys", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="leader_key", property="leaderKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_names", property="attrNames", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="saas_userid", property="saasUserid", jdbcType=JdbcType.CHAR),
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_endtime", property="activityEndtime", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCart> selectByExampleWithRowbounds(MallCartExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCartSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="cart_key", property="cartKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_keys", property="attrKeys", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="leader_key", property="leaderKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_names", property="attrNames", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="saas_userid", property="saasUserid", jdbcType=JdbcType.CHAR),
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_endtime", property="activityEndtime", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCart> selectByExample(MallCartExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "cart_key, app_key, user_key, goods_key, num, attr_keys, create_time, leader_key, ",
        "update_time, attr_names, store_key, saas_userid, activity_key, activity_endtime, ",
        "customer_key, version",
        "from mall_cart",
        "where cart_key = #{cartKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="cart_key", property="cartKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_keys", property="attrKeys", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="leader_key", property="leaderKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="attr_names", property="attrNames", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="saas_userid", property="saasUserid", jdbcType=JdbcType.CHAR),
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_endtime", property="activityEndtime", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallCart selectByPrimaryKey(String cartKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCartSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallCart record, @Param("example") MallCartExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCartSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallCart record, @Param("example") MallCartExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCartSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallCart record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_cart
     *
     * @mbg.generated
     */
    @Update({
        "update mall_cart",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "user_key = #{userKey,jdbcType=VARCHAR},",
          "goods_key = #{goodsKey,jdbcType=VARCHAR},",
          "num = #{num,jdbcType=INTEGER},",
          "attr_keys = #{attrKeys,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "leader_key = #{leaderKey,jdbcType=VARCHAR},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "attr_names = #{attrNames,jdbcType=VARCHAR},",
          "store_key = #{storeKey,jdbcType=VARCHAR},",
          "saas_userid = #{saasUserid,jdbcType=CHAR},",
          "activity_key = #{activityKey,jdbcType=VARCHAR},",
          "activity_endtime = #{activityEndtime,jdbcType=VARCHAR},",
          "customer_key = #{customerKey,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where cart_key = #{cartKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallCart record);
}